package service

import (
	"gitee.com/liumou_site/go-service"
	"go.uber.org/zap"
)

// ServiceManager 服务管理器
type ServiceManager struct {
	serviceName string
	service     *go_service.Service
}

// NewServiceManager 创建服务管理器
// 示例值: serviceName="ssh"
func NewServiceManager(serviceName string) *ServiceManager {
	// 创建go-service服务实例
	service, err := go_service.NewService(serviceName, "SSH Service", "")
	if err != nil {
		zap.S().Errorf("创建服务实例失败: %v", err)
		// 返回一个基础的服务管理器，后续操作可能会失败
		return &ServiceManager{
			serviceName: serviceName,
			service:     nil,
		}
	}
	
	return &ServiceManager{
		serviceName: serviceName,
		service:     service,
	}
}